package com.njlime.sys.repository;

import com.njlime.core.helper.PageBean;
import com.njlime.sys.entities.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Map;

/**
 * Created by Dean on 2017-7-27.
 */
public interface UserDao extends JpaRepository<User, Integer>,JpaSpecificationExecutor<User> {
    User getByLoginName(String loginName);
    PageBean list(PageBean pageBean, User user);
    int deleteUser(Integer id);
    int updateUser(User user);
    List<Map<String, Object>> getUserByRole(Integer role_id);
    User getByOpenid(String openid);
    User get(Integer id);
    Map<String, Object> getUserMap(Integer id);
    User getByMobile(String mobile, boolean available);
}
